package com.hhh.sun.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName tb_order
 */
@ApiModel(description = "")
@TableName(value ="tb_order")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class TbOrder implements Serializable {
    /**
     * 订单id
     */
    @ApiModelProperty(value = "订单id", position = 1)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id", position = 2)
    private Integer userId;

    /**
     * 充电站id
     */
    @ApiModelProperty(value = "充电站id", position = 3)
    private Integer chargingId;

    /**
     * 预约开始时间，如果超过订单预约时间30分钟 未进行充电，订单会失效
     */
    @ApiModelProperty(value = "预约开始时间，如果超过订单预约时间30分钟 未进行充电，订单会失效", position = 4)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
    private Date beginTime;

    /**
     * 要充电的时长，以分钟为单位
     */
    @ApiModelProperty(value = "要充电的时长，以分钟为单位", position = 5)
    private Integer lastTime;

    /**
     * 该订单的创建时间
     */
    @ApiModelProperty(value = "该订单的创建时间", position = 6)
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
    private Date createTime;

    /**
     * 该订单的修改时间
     */
    @ApiModelProperty(value = "该订单的修改时间", position = 7)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/shanghai")
    private Date updateTime;

    /**
     * 订单的状态，-1为未在规定时间内进行充电，0为还未到预约充电时间，1为订单正常完成
     */
    @ApiModelProperty(value = "订单的状态，-1为未在规定时间内进行充电，0为还未到预约充电时间，1为订单正常完成", position = 8)
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}